let str1 = ','
let str2 = '88,'
let str3 = '88,89'


function trimRight(str){
	if(str.charAt(str.length - 1) === ','){
		return str.substring(0,str.length - 1)
	}
	return str
}


console.log(trimRight(str1).length);
console.log(trimRight(str2));
console.log(trimRight(str3));
